package com.zxx.pattern.observerPattern.observer_bus_reason;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author zxx on 2021/3/11
 */
public class UserA implements Parcelable {

    String name;

    public UserA(String name) {
        this.name = name;
    }

    protected UserA(Parcel in) {
        name = in.readString();
    }

    public static final Creator<UserA> CREATOR = new Creator<UserA>() {
        @Override
        public UserA createFromParcel(Parcel in) {
            return new UserA(in);
        }

        @Override
        public UserA[] newArray(int size) {
            return new UserA[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
    }

    @Override
    public String toString() {
        return "UserA{" +
                "name='" + name + '\'' +
                '}';
    }
}
